package com.study.test;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/hello2")
public class HelloController2 {
    Logger logger = LoggerFactory.getLogger(HelloController2.class);

    @Value("$M{name}")
    private String name;

    @RequestMapping(value = "/test2",method = RequestMethod.GET)
    public String printWelcome(ModelMap model) {
        logger.info("hello2 test2");
        System.out.println("已经被检测掉");
        model.addAttribute("message", "Hello world!");
        return "hello";
    }
}